package com.example.demo.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * @author hankChan
 *         2018/2/2 0002.
 */
public class ValidateRequestBody implements Serializable {

    private static final long serialVersionUID = -8470246780763792981L;

    @Max(value = 9999, message = "id最大值为9999")
    @Min(value = 1000, message = "id最小值为1000")
    @NotNull(message = "id不得为空!")
    @SerializedName("id")
    @JsonProperty("id")
    private Long id;

    @NotNull(message = "name不得为空!")
    @SerializedName("name")
    @JsonProperty("name")
    private String name;

    @SerializedName("type")
    @JsonProperty("type")
    private Integer type;

    @Size(min = 20, max = 500, message = "desc必须在20-500个字符之间!")
    @SerializedName("desc")
    @JsonProperty("desc")
    private String desc;

    @Size(max = 3, message = "urls列表最大数量为3")
    @NotEmpty(message = "urls不得为空集合!")
    @Valid
    @SerializedName("urls")
    @JsonProperty("urls")
    private List<Image> urls;

    @SerializedName("is_refresh")
    @JsonProperty("is_refresh")
    private Boolean isRefresh;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Boolean getIsRefresh() {
        return isRefresh;
    }

    public void setIsRefresh(Boolean refresh) {
        isRefresh = refresh;
    }

    public List<Image> getUrls() {
        return urls;
    }

    public void setUrls(List<Image> urls) {
        this.urls = urls;
    }
}
